import request from '@/utils/request'

// 查询设备管理 设备台账列表
export function listInfo(query) {
    return request({
        url: '/equipment/info/list',
        method: 'get',
        params: query
    })
}
//所有的设备下拉--首页用
export function getEquipmentOptionsAllIndex(query) {
    return request({
        url: '/equipment/info/noPageList',
        method: 'get',
        params: query
    })
}
// 查询设备管理 设备台账详细
export function getInfo(equipmentId) {
    return request({
        url: '/equipment/info/' + equipmentId,
        method: 'get'
    })
}

// 新增设备管理 设备台账
export function addInfo(data) {
    return request({
        url: '/equipment/info',
        method: 'post',
        data: data
    })
}

// 修改设备管理 设备台账
export function updateInfo(data) {
    return request({
        url: '/equipment/info',
        method: 'put',
        data: data
    })
}

// 删除设备管理 设备台账
export function delInfo(equipmentId) {
    return request({
        url: '/equipment/info/' + equipmentId,
        method: 'delete'
    })
}

// 获取组织信息
export function listDeptOptions(query) {
    return request({
        url: '/system/dept/list',
        method: 'get',
      params: query
    })
}


// 查询用户列表
export function getResponseManOptions(query) {
    return request({
      url: '/system/user/list',
      method: 'get',
      params: query
    })
  }


export function getSulipperOptions(query){
    return request({
        url: '/base/supplier/list',
        method: 'get',
        params: query
    })
}


export function disableEquipment(equipmentId){
    return request({
        url: '/equipment/info/disable/'+equipmentId,
        method: 'get'
    })
}
// 设备管理 添加任务使用的下拉数据， 启用&&在线&&空闲&&加工中，不包含离线的&&停用的
export function getEquipmentOptions() {
    return request({
        url: '/equipment/info/getUsableEquipment',
        method: 'get'
    })
}
//所有的设备下拉
export function getEquipmentOptionsAll() {
    return request({
        url: '/equipment/info/noPageList',
        method: 'get',
        params: {status:1}
    })
}

export function updateEquipmentStatus(data) {
    return request({
        url: '/equipment/info/updateEquipmentStatus',
        method: 'post',
        data:data
    })
}